package c.e.a.b.e.c;

import android.content.ContentResolver;
import android.database.ContentObserver;
import android.net.Uri;
import b.f.a;
import b.f.g.e;
import b.f.h;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Objects;

/* compiled from: com.google.android.gms:play-services-measurement-impl@@18.0.0 */
public final class y1 implements b2 {
    public static final Map<Uri, y1> g = new a();
    public static final String[] h = new String[]{"key", "value"};
    public final ContentResolver a;
    public final Uri b;
    public final ContentObserver c;
    public final Object d = new Object();
    public volatile Map<String, String> e;
    public final List<z1> f = new ArrayList();

    public y1(ContentResolver contentResolver, Uri uri) {
        a2 a2Var = new a2(this);
        this.c = a2Var;
        Objects.requireNonNull(contentResolver);
        Objects.requireNonNull(uri);
        this.a = contentResolver;
        this.b = uri;
        contentResolver.registerContentObserver(uri, false, a2Var);
    }

    /* JADX WARNING: Missing exception handler attribute for start block: B:15:0x001b */
    /* JADX WARNING: Can't wrap try/catch for region: R(8:2|3|4|5|6|(6:8|9|10|11|12|13)|15|16) */
    public static c.e.a.b.e.c.y1 b(android.content.ContentResolver r4, android.net.Uri r5) {
        /*
        r0 = c.e.a.b.e.c.y1.class;
        monitor-enter(r0);
        r1 = g;	 Catch:{ all -> 0x001d }
        r2 = r1;
        r2 = (b.f.h) r2;
        r2 = r2.get(r5);	 Catch:{ all -> 0x001d }
        r2 = (c.e.a.b.e.c.y1) r2;	 Catch:{ all -> 0x001d }
        if (r2 != 0) goto L_0x001b;
    L_0x0010:
        r3 = new c.e.a.b.e.c.y1;	 Catch:{ SecurityException -> 0x001b }
        r3.m5757init(r4, r5);	 Catch:{ SecurityException -> 0x001b }
        r1 = (b.f.h) r1;
        r1.put(r5, r3);	 Catch:{ SecurityException -> 0x001a }
    L_0x001a:
        r2 = r3;
    L_0x001b:
        monitor-exit(r0);	 Catch:{ all -> 0x001d }
        return r2;
    L_0x001d:
        r4 = move-exception;
        monitor-exit(r0);	 Catch:{ all -> 0x001d }
        throw r4;
        */
        throw new UnsupportedOperationException("Method not decompiled: c.e.a.b.e.c.y1.b(android.content.ContentResolver, android.net.Uri):c.e.a.b.e.c.y1");
    }

    public static synchronized void d() {
        Map map = g;
        synchronized (y1.class) {
            Iterator it = ((e) ((a) map).values()).iterator();
            while (it.hasNext()) {
                y1 y1Var = (y1) it.next();
                y1Var.a.unregisterContentObserver(y1Var.c);
            }
            ((h) map).clear();
        }
    }

    public final /* synthetic */ Object a(String str) {
        return (String) c().get(str);
    }

    /* JADX WARNING: Missing exception handler attribute for start block: B:13:0x0020 */
    /* JADX WARNING: Failed to process nested try/catch */
    /* JADX WARNING: Can't wrap try/catch for region: R(5:13|14|15|26|25) */
    /* JADX WARNING: Missing block: B:14:?, code skipped:
            android.util.Log.e("ConfigurationContentLoader", "PhenotypeFlag unable to load ContentProvider, using default values");
     */
    /* JADX WARNING: Missing block: B:17:0x002f, code skipped:
            android.os.StrictMode.setThreadPolicy(r0);
     */
    /* JADX WARNING: Missing block: B:25:?, code skipped:
            r2 = null;
     */
    public final java.util.Map<java.lang.String, java.lang.String> c() {
        /*
        r4 = this;
        r0 = r4.e;
        if (r0 != 0) goto L_0x0038;
    L_0x0004:
        r1 = r4.d;
        monitor-enter(r1);
        r0 = r4.e;	 Catch:{ all -> 0x0035 }
        if (r0 != 0) goto L_0x0033;
    L_0x000b:
        r0 = android.os.StrictMode.allowThreadDiskReads();	 Catch:{ all -> 0x0035 }
        r2 = new c.e.a.b.e.c.x1;	 Catch:{ SQLiteException | IllegalStateException | SecurityException -> 0x0020, SQLiteException | IllegalStateException | SecurityException -> 0x0020, SQLiteException | IllegalStateException | SecurityException -> 0x0020 }
        r2.m5748init(r4);	 Catch:{ SQLiteException | IllegalStateException | SecurityException -> 0x0020, SQLiteException | IllegalStateException | SecurityException -> 0x0020, SQLiteException | IllegalStateException | SecurityException -> 0x0020 }
        r2 = c.e.a.b.b.j.d.t(r2);	 Catch:{ SQLiteException | IllegalStateException | SecurityException -> 0x0020, SQLiteException | IllegalStateException | SecurityException -> 0x0020, SQLiteException | IllegalStateException | SecurityException -> 0x0020 }
        r2 = (java.util.Map) r2;	 Catch:{ SQLiteException | IllegalStateException | SecurityException -> 0x0020, SQLiteException | IllegalStateException | SecurityException -> 0x0020, SQLiteException | IllegalStateException | SecurityException -> 0x0020 }
        android.os.StrictMode.setThreadPolicy(r0);	 Catch:{ all -> 0x0035 }
        goto L_0x002b;
    L_0x001e:
        r2 = move-exception;
        goto L_0x002f;
    L_0x0020:
        r2 = "ConfigurationContentLoader";
        r3 = "PhenotypeFlag unable to load ContentProvider, using default values";
        android.util.Log.e(r2, r3);	 Catch:{ all -> 0x001e }
        android.os.StrictMode.setThreadPolicy(r0);	 Catch:{ all -> 0x0035 }
        r2 = 0;
    L_0x002b:
        r4.e = r2;	 Catch:{ all -> 0x0035 }
        r0 = r2;
        goto L_0x0033;
    L_0x002f:
        android.os.StrictMode.setThreadPolicy(r0);	 Catch:{ all -> 0x0035 }
        throw r2;	 Catch:{ all -> 0x0035 }
    L_0x0033:
        monitor-exit(r1);	 Catch:{ all -> 0x0035 }
        goto L_0x0038;
    L_0x0035:
        r0 = move-exception;
        monitor-exit(r1);	 Catch:{ all -> 0x0035 }
        throw r0;
    L_0x0038:
        if (r0 == 0) goto L_0x003b;
    L_0x003a:
        return r0;
    L_0x003b:
        r0 = java.util.Collections.emptyMap();
        return r0;
        */
        throw new UnsupportedOperationException("Method not decompiled: c.e.a.b.e.c.y1.c():java.util.Map");
    }
}
